package org.pay.core.service;

import org.pay.core.entity.PayChannel;

import java.util.List;

/**
 * @author: yangshancheng
 * @date: 17/9/8
 * @description:
 */
public interface IPayChannelService {

    int add(PayChannel payChannel);

    int update(PayChannel payChannel);

    PayChannel findById(int id);

    PayChannel findByChannelId(String channelId);

    /**
     * 根据通道ID和渠道ID获取唯一的支付渠道(状态可用)
     * @param passageId
     * @param channelId
     * @return
     */
    PayChannel findByPassageAndChannelId(Integer passageId, String channelId);

    PayChannel findByPassageAndChannelId(Integer passageId, String channelId, Byte status);

    List<PayChannel> select(int pageIndex, int pageSize, PayChannel payChannel);

    Integer count(PayChannel payChannel);

    List<PayChannel> selectByPassageId(Integer passageId, Byte scene);

    /**
     * 查询商户的支付渠道(针对平台账户)
     * @param mchId
     * @param channelId
     * @return
     */
    List<PayChannel> selectByMch(Long mchId, String channelId);

    List<PayChannel> selectByChannelIds(PayChannel payChannel, List<String> channelIds);

    List<PayChannel> selectAll(PayChannel payChannel);

}
